# -*- coding: utf-8 -*-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#作者：cacho_37967865
#博客：https://blog.csdn.net/sinat_37967865
#文件：md5_encrypt.py
#日期：2019-07-31
#备注：多种加解密方法    # pip install pycryptodome
用pyCryptodome模块带的aes先将秘钥以及要加密的文本填充为16位   AES key must be either 16 or 32 bytes long
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

import hashlib


# org_str加密字符串
def md5_encrypt(o_token):
    print("MD5参与签名字符串为：",o_token)
    hl = hashlib.md5()
    hl.update(o_token.encode(encoding='utf-8'))
    token = hl.hexdigest()
    print('MD5验签签名为：' + token)
    return token


def md5_upper(o_token):
    print("MD5参与签名字符串为：",o_token)
    hl = hashlib.md5()
    hl.update(o_token.encode(encoding='utf-8'))
    token = hl.hexdigest().upper()
    print('MD5验签签名为：' + token)
    return token


if __name__ == '__main__':
    md5_upper('xxx')